package test;

import java.io.File;

import junit.framework.TestCase;

import com.fzy.core.codetools.Generator;
import com.fzy.core.codetools.Utils;

public class T extends TestCase {
	/**
	 * 
	 */
	public void test1(){
		String appPath = "D:/code/google/fzy/t120528";
		String outputPath = "/out";
		
		Utils.deleteFileDeeply(new File(appPath + outputPath));
		
		Generator.writeEntity("entity.ftl", ".java", "entity", "/src");
		Generator.writeMapping("schema.ftl", "schema.sql", "/doc");
		Generator.writeEntityHasId("entity-hbm.ftl", ".hbm.xml", "entity", "/src");
//		Generator.writeCompositeId("composite-id.ftl", "Id.java", "entity", "/src");
		Generator.writeEntity("entity-validation.ftl", "-validation.xml", "entity", "/src");
		Generator.writeEntity("entity-properties-zh_CN.ftl", "_zh_CN.properties", "entity", "/src");
		Generator.writeEntity("service-list-mapper.ftl", "ListMapper.java", "service", "/src");
		Generator.writeEntity("service-list-vo.ftl", "ListVo.java", "service", "/src");
//		Generator.writeEntity("service-list-query.ftl", "ListQuery.java", "service", "/src");
//		Generator.writeEntity("service.ftl", "Service.java", "service", "/src");
//		Generator.writeEntity("action-input.ftl", "InputAction.java", "action", "/src");
//		Generator.writeEntity("action-list.ftl", "ListAction.java", "action", "/src");
//		Generator.writeEntity("action-save.ftl", "SaveAction.java", "action", "/src");
//		Generator.writeEntity("action-save-validation.ftl", "SaveAction-validation.xml", "action", "/src");
//		Generator.writeJsp("jsp-input.ftl", "-input.jsp");
//		Generator.writeJsp("jsp-list.ftl", "-list.jsp");
//		Generator.writeModule("spring.ftl", "spring-", "/src/spring");
//		Generator.writeModule("webwork.ftl", "xwork-", "/src/webwork");
//		Generator.writeMapping("menus.ftl", "menus.html", "/WebRoot");
		Generator.writeMapping("schema-oracle.ftl", "schema-oracle.sql", "/doc");
		
//		String[] tables = new String[]{
//				"auth_usermsg", "auth_emply", "auth_grprel", "auth_grptype", 
//				"tdn_dealer", "tdn_rssc", "tdn_rssc_province", "ms_auth_memusr_new",
//				"tdn_recruit_apply_info", 
//				"tdn_recruit_shareholder", "tdn_recruit_apply_other4s", "tdn_recruit_city_info", "tdn_recruit_construction", 
//				"tdn_recruit_manager_history", "tdn_recruit_serial", 
//				"tdn_recruit_visit_option", "tdn_code", "tdn_recruit_resource", "tdn_recruit_res_role_rel", "tdn_attach"};
//		String moduleName = "dx";
//		String moduleTitle = "广域网";
//		Generator.writeMappingFromDb("mapping.ftl", "mapping.xml", "/doc", tables, moduleName, moduleTitle);
	}
}
